
<div id="div_caisse" class="row-fluid">

    <div class="span12">

        <div class="box gradient">

            <div class="title">
                <h4>
                    <span>List Caisse</span>
                </h4>
            </div>
            <div id="div-list-user" class="content noPad clearfix">
                <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
                    <div id="DataTables_Table_0_filter" class="dataTables_filter">
                        <table>
                            <tr>
                                <td>
                                    <label>
                                        Code :
                                        <input class="text" type="text" id="filtre_code" aria-controls="DataTables_Table_0"/>
                                    </label>
                                </td>
                                <td>
                                    <label>
                                        Libelle :
                                        <input class="text" type="text" id="filtre_libelle" aria-controls="DataTables_Table_0"/>
                                    </label>
                                </td>
                            </tr>
                        </table>


                    </div>
                    <div id="DataTables_Table_0_length" class="dataTables_length">
                        <button onclick="newCaisse()" class="btn btn-primary"><span class="icon16 cut-icon-plus white"></span>Nouveau Caisse</button>

                    </div>

                    <div id="list_caisse">

                {% include 'GdsVenteBundle:Caisse:pageList.html.twig' %}
                    </div>
                </div>
            </div>
        </div>
    </div><!-- End .box -->

</div><!-- End .span12 -->

</div><!-- End .row-fluid -->
<script>
    $('#filtre_libelle').keyup(function() {
        goToPage('{{path(pagination.route)}}?type=ajax')
    })
    $('#filtre_code').keyup(function() {
        goToPage('{{path(pagination.route)}}?type=ajax')
    })
    function goToPage(url) {
        $.ajax({
            url: url,
            data: '&libelle=' + $('#filtre_libelle').val()+'&code='+$('#filtre_code').val(),
            success: function(data) {
                $('#list_caisse').html(data)
            }
        })
    }
    function newCaisse(){
       $.ajax({
           url: '{{path('gds_caisse_new')}}',
           success: function(data){
               $('#div_caisse').html(data)
           }
       })
    }
    </script>

